package com.parachutes.aspsystemapi.feign;

import com.parachutes.aspsystemapi.domian.Result;
import com.parachutes.aspsystemapi.domian.SysUser;
import feign.hystrix.FallbackFactory;

public class SysUserServiceFallback implements FallbackFactory<SysUserServiceFeign> {

    @Override
    public SysUserServiceFeign create(Throwable throwable) {
        return new SysUserServiceFeign() {
            @Override
            public Result<SysUser> getUser(Integer id) {
                return Result.of(false, "系统异常，请稍后再试", null);
            }

            @Override
            public Result<SysUser> updateUser(SysUser sysUser) {
                return Result.of(false, "系统异常，请稍后再试", null);
            }
        };
    }
}
